<template>
    <van-nav-bar title="订单详情" left-text="返回" left-arrow @click-left="onBack" />
    <div class="near-box">
        <div class="jd-qrdd-bigbox" v-for="item of orderdata">
            <!--商品地址管理部分-->
            <div class="indent-details-box" style="height:auto;">
                <span class="indent-details-img1"></span>
                <span class="indent-details-text1"></span>
            </div>
            <!--地址部分-->
            <div class="jd-qrdd-a1">
                <span class="qrdd-a1-t1 username">{{ item.address.consignee }}</span>
                <span class="qrdd-a1-t1 mobile">{{ item.address.mobile }}</span>
                <span class="qrdd-a1-t2" v-if="item.address.status==1">默认</span>
                <div class="qrdd-a1-b1">
                    <span class="qrdd-a1-img1"></span>
                    <span class="qrdd-a1-t3">{{ item.address.region_text }}-{{ item.address.address }}</span>
                </div>
                <span class="qrdd-a1-img2"></span>
            </div>
            <!--商品部分-->
            <div class="zjzz-buylist-goods1">

            </div>
            <!--商品金额部分-->
            <div class="indent-details-box2">
                <span class="indent-details-text4 tcolor-grey">订单总价</span>
                <span class="indent-details-text5 tcolor-black">{{ item.amount }}</span>
            </div>
            <!--订单编号部分-->
            <div class="indent-details-box3">
                <p>订单编号:{{ item.code }}</p>
                <p>下单时间:{{ item.createtime_text }}</p>
            </div>
        </div>
    </div>
</template>
<script setup>
import { getCurrentInstance, ref, reactive, onMounted } from 'vue';
const { proxy } = getCurrentInstance();
const busid = reactive(proxy.$cookies.get('business').id);
const orderid = ref(proxy.$route.query.id);
const orderdata = reactive([]);
onMounted(()=>{
    getProductOrder();
})
const getProductOrder = async ()=>{
    let data = {
        busid:busid,
        orderid:orderid.value
    }
    let result = await proxy.$Api.getProductOrder(data);
    if(result && result.code==1){
        orderdata.push(...result.data)
    }
}
const onBack = ()=>{
    proxy.$router.back();
}
</script>
<style>
@import url('/assets/css/indent-details.css');
</style>